package com.ophiux.system;

import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
import com.ophiux.common.feign.annotation.EnableOphiuxFeignClients;
import com.ophiux.common.security.annotation.EnableSecurityResourceServer;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

/**
 * @desc:
 * @author: hhl
 * @date：2022/7/19 12:05
 */
@EnableOphiuxFeignClients
@EnableDiscoveryClient
@SpringBootApplication
@MapperScan("com.ophiux.system.mapper")
@EnableSecurityResourceServer
//@SpringBootApplication(exclude={SecurityAutoConfiguration.class, UserDetailsServiceAutoConfiguration.class, ManagementWebSecurityAutoConfiguration.class})
public class SystemApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(SystemApplication.class, args);
        Environment evn = context.getBean(Environment.class);
        NacosDiscoveryProperties nacosDiscoveryProperties = context.getBean(NacosDiscoveryProperties.class);
        System.out.println("http://"+nacosDiscoveryProperties.getIp()+":"+nacosDiscoveryProperties.getPort()+"/swagger-ui/index.html");
        System.out.println("system服务启动成功,端口：" + evn.getProperty("server.port"));
    }
}
